package com.yuanfeng.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanfeng.business.dto.*;
import com.yuanfeng.business.entity.ShopJoinBaseEntity;
import com.yuanfeng.business.vo.*;
import com.yuanfeng.commoms.dto.userms.BusinessUserInfoDTO;
import com.yuanfeng.commoms.vo.user.UserInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * (ShopJoinBase)
 *
 * @since 2023-05-19 15:35:47
 */
@Mapper
public interface ShopJoinBaseMapper extends BaseMapper<ShopJoinBaseEntity> {

    /**
     * 查询店铺入驻信息
     * @param param
     * @return
     */
    ShopJoinInitResult queryShopJoinInfo(@Param("param") Map<String, Object> param);
    /**
     * 通过userid查询总数
     * @param param
     * @return
     */
    Integer queryShopBaseCount(@Param("param") Map<String, Object> param);
    /**
     * 根据userid查询未锁定状态的用户
     * @param userId
     * @return
     */
    UserInfoVO getUserInfoByPhoneNumber(String userId);

    /**
     * 根据userId查询待审核的店铺
     * @param param
     * @return
     */
    Integer queryAuditingShopCount(@Param("param") Map<String, Object> param);

    /**
     * 插入店铺的信息
     * @param param
     */
    void insertShopJoinBase(@Param("param") Map<String, Object> param);

    /**
     * 店铺入住信息更改
     * @param param
     */
    void updateShopJoinBase(@Param("param") Map<String, Object> param);

    /**
     * 店铺入驻-查询
     *
     * @param param
     * @return
     */
    ShopJoinInfoVO queryShopJoinBase(@Param("param") Map<String, Object> param);

    /**
     * 店铺入驻-查询支付凭证
     *
     * @param param
     * @return
     */
    ShopPayInitInfoVO queryShopPayInfo(@Param("param") Map<String, Object> param);

    /**
     * 校验公司名称是否重复
     *
     * @param param
     * @return
     */
    Integer checkCompanyName(@Param("param") Map<String, Object> param);

    /**
     * 校验手机号是否已注册
     *
     * @param param
     * @return
     */
    Integer checkPhoneNumber(@Param("param") Map<String, Object> param);


    /**
     *
     * @param param
     * @return
     */
    ShopJoinInfoDetailForPlatformVO queryShopJoinDetailForPlatformEntity(@Param("param") Map<String, Object> param);


    Map<String, Object> queryShopPersonInfo(@Param("param") Map<String, Object> param);

    /**
     * 获取分类id
     *
     * @param shopClassId
     * @return
     */
    Integer queryShopClassId(@Param("shopClassId") Integer shopClassId);

    /**
     * 查询商店卖方银行
     * @param param
     * @return
     */
    ShopJoinInfoBaseBankForSellerDTO queryShopJoinBaseBankForSeller(@Param("param") Map<String, Object> param);

    /**
     * 查询电话基础信息
     * @param param
     * @return
     */
    ShopJoinInfoBaseForSellerDTO queryShopJoinBaseForSeller(@Param("param") Map<String, Object> param);

    /**
     * 查询店铺信息
     * @param param
     * @return
     */
    ShopPersonInfoDTO queryShopPersonInfo2(@Param("param") Map<String, Object> param);

    /**
     * 查询店铺基础信息
     * @param param
     * @return
     */
    ShopJoinInfoBaseQualiForSellerVO queryShopJoinBaseQualiForSeller(@Param("param") Map<String, Object> param);

    /**
     * 更新店铺基础信息
     * @param param
     */
    void updateShopJoinBaseForSeller(@Param("param") Map<String, Object> param);

    /**
     * 更新店铺银行信息
     * @param param
     */
    void updateShopJoinBankInfoForSeller(@Param("param") Map<String, Object> param);

    /**
     * 查询账号
     * @param shopId
     * @return
     */
    List<UserSellerBaseDTO> getSubAccount(@Param("shopId") String shopId);

    /**
     * 查询店铺状态
     * @param userId
     * @return
     */
    Integer queryShopStatus(@Param("userId") String userId);

    /**
     * 查询部门用户信息
     * @param param
     * @return
     */
    BusinessUserInfoDTO queryInfo(@Param("param") Map<String, Object> param);

    /**
     * 查询创建人ID
     * @param userId
     * @return
     */
    String getPrimaryAccountId(@Param("userId") String userId);


    /**
     * 平台查看待审核入驻详情
     *
     * @param param
     * @return
     */
    ShopJoinInfoDetailForPlatformVO queryShopJoinBaseDetailForPlatform(@Param("param") Map<String, Object> param);


    /**
     * 分页查询店铺
     *
     * @param page
     * @param param
     * @return
     */
    IPage<ShopJoinInfoForPlatformVO> selectShopJoinBaseForPlatform(Page<ShopJoinInfoForPlatformVO> page, @Param("param") Map<String, Object> param);


    String selectuserphone(@Param("param") String userId);

}

